package ConfigFile;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import model.general.Location;
import model.general.Util;

public class Stores {

	public static void saveFile(Object conf, String filename) {
		File file = new File(filename);
		try {
			ObjectOutputStream oos = new ObjectOutputStream(
					new FileOutputStream(file));
			oos.writeObject(conf);
			oos.flush();
			oos.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void deleteFile(String filename) {
		File file = new File(filename);
		file.delete();
	}

	public static void main(String[] args) {
		ConfigFile file = new ConfigFile();
		file.setLevel(1);
		file.setLife(3);
		file.setScore(10);
		file.setLocation_boat(new Location(0, 0));
		file.setLocation_hook(new Location(0, 80));
		file.setLocation_light(new Location(0, 0));
		file.setQUATITY_BAD_ITEMS(1);
		file.setQUATITY_FISH(7);
		file.setQUATITY_GOOD_ITEMS(6);
		file.setQUATITY_SPEED_IIEMS(10);
		file.setElementProperties(Util.ID_BOAT_IMG_LEFT, "image boat left");

		// saveFile(file,Util.CONFIG_FILE);

		// file = Loads.loadConfigFile();
		// System.out.println("location boat " + file.getLocation_boat());
		// System.out.println("image boat left "
		// + file.getElementProperties(Util.ID_BOAT_IMG_LEFT));
		// System.out.println("life " + file.getLife());
	}

}
